package yto.freemarker.java8.entity;

import java.util.Objects;

/**
 * 实体类
 *
 * @author dongxing
 * @create 2018-06-13 23:01
 **/
public class Employee {
    private String name;
    private Integer age;
    private Double solary;

    private Status status;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(name, employee.name) &&
                Objects.equals(age, employee.age) &&
                Objects.equals(solary, employee.solary);
    }

    public Employee(String name, Integer age, Double solary, Status status) {
        this.name = name;
        this.age = age;
        this.solary = solary;
        this.status = status;
    }

    @Override
    public int hashCode() {

        return Objects.hash(name, age, solary);
    }

    public Employee() {
    }

    public Employee(String name, Integer age, Double solary) {

        this.name = name;
        this.age = age;
        this.solary = solary;
    }

    public Employee(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public Employee(Integer age, Double solary) {
        this.age = age;
        this.solary = solary;
    }

    public Employee(String name, Double solary) {

        this.name = name;
        this.solary = solary;
    }

    public Employee(Double solary) {

        this.solary = solary;
    }

    public Employee(Integer age) {

        this.age = age;
    }

    public Employee(String name) {

        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getSolary() {
        return solary;
    }

    public void setSolary(Double solary) {
        this.solary = solary;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", solary=" + solary +
                ", status=" + status +
                '}';
    }

    public enum Status {
        FREE,
        BUSY,
        VOCATION


    }
}
